import React, { useContext } from 'react'
import { ThemeContext } from '../App'

interface IHelloProps {
	message?: string
	children?: React.ReactNode[] | React.ReactNode
}

const Hello: React.FC<IHelloProps> = (props) => {
	const theme = useContext(ThemeContext)
	return (
		<>
			<h2 style={theme}>{props.message}</h2>
			{props.children}
		</>
	)
}

Hello.defaultProps = {
	message: 'Hello World',
	children: []
}

export default Hello
